package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TaskTagRule;
import com.atguigu.userprofile.util.MySQLUtil;

import java.util.List;

public class TaskTagRuleDao {
    public static List<TaskTagRule> getTaskTagRule(String taskId){
        String sql = "SELECT " +
                "tr.id," +
                "tr.tag_id," +
                "tr.task_id," +
                "tr.query_value," +
                "tr.sub_tag_id," +
                "ti.tag_name as sub_tag_value " +
                "FROM task_tag_rule AS tr " +
                "JOIN " +
                "tag_info AS ti " +
                "ON tr.sub_tag_id=ti.id " +
                "WHERE tr.task_id='"+taskId+"'";

        return MySQLUtil.queryList(sql, TaskTagRule.class, true);
    }
}
